// ignore_for_file: public_member_api_docs, sort_constructors_first

import 'package:badges/badges.dart' as badges;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:oi_ai_tool/common/oi_font.dart';
import 'package:oi_ai_tool/util/string_extention.dart';

class OiChatBadge extends StatelessWidget {
  final Widget child;
  final Widget? badgeContent;
  final Function onTap;

  const OiChatBadge(
      {super.key, required this.child, this.badgeContent, required this.onTap});

  @override
  Widget build(BuildContext context) {
    return badges.Badge(
      badgeContent: badgeContent,
      badgeAnimation: const badges.BadgeAnimation.scale(),
      position: badges.BadgePosition.topEnd(top: -6.sp, end: -6.sp),
      badgeStyle: badges.BadgeStyle(
          badgeColor: const Color(0xFF01CAE5),
          elevation: 0,
          borderSide: BorderSide.none,
          badgeGradient: badges.BadgeGradient.radial(
            colors: ["#FF01CAE5".toColor(), Colors.white],
          )),
      onTap: () => onTap(),
      child: child,
    );
  }
}
